<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<html>
<head>
<title>List Addresses</title>
</head>
<body>
<f:view>
	<h:form>
	<h4 align="center">List Addresses</h4>
	<table>
		<tr>
			<td>
				<ul class="list_subsub_kisa">
				<li>
					<a href="editUserAccount.jsf" title="KullaniciGuncelle">Bilgileri Guncelle</a>
				</li>
				<li>
					<a href="mainUserForm.jsf" title="KullaniciAnaSayfa">Kullanici Ana Sayfasi</a>
				</li>
				</ul>
			</td>
			<td>
				<div class="columnMiddle"><rich:spacer width="1" height="50" />
					<rich:panel style="width:500px;background-color: #ebf3fd;">
						<f:facet name="header">
							<h:outputText value="Address List"></h:outputText>
						</f:facet>
						<h:panelGrid columns="1" style="width:500px;">
			
							<rich:dataTable id="addressListTable" value="#{listAddressesController.addresses}"
											style="margin-left:0;" var="address" rows="5" width="480"
											binding="#{listAddressesController.addressesTable}">

						        <f:facet name="header">
						                <h:outputText value="List of Addresses" />
						        </f:facet>

						        <rich:column>
						                <f:facet name="header">
						                	<h:outputText value="Adres Sahibi" />						               		
						                </f:facet>
						                <h:outputText value="#{address.name}"/>
						        </rich:column>

						        <rich:column>
						                <f:facet name="header">
						                	<h:outputText value="Posta Kodu" />
						                </f:facet>
						                <h:outputText value="#{address.postalCode}"/>
						        </rich:column>
						
						        <rich:column >
						                <f:facet name="header">
						                	<h:outputText value="No" />
						                </f:facet>
						                <h:outputText value="#{address.streetNumber}"/>
						        </rich:column>
						        
						        <rich:column>
									<f:facet name="header">
										<h:outputText value="Goruntule" />
									</f:facet>
									<h:commandButton value="Goruntule"
										image="/images/view.gif"
										action="#{listAddressesController.goruntule}"/>
								</rich:column>
						
							</rich:dataTable>
		
						</h:panelGrid>
					</rich:panel>
				</div>
			</td>
		</tr>
	</table>
	</h:form>
</f:view>
</body>

</html>